#include "CManorBattleData.h"

/*********************************************************************/
/*                    CManorBattleRank                               */
/*********************************************************************/
template<>
bool CRankArray<CManorBattleDefUnit, MAX_MANOR_BATTLE_DEFEND_RANK>::IsSame(
        CManorBattleDefUnit& stA, CManorBattleDefUnit& stB) const
{
    return (stA.GetGID() == stB.GetGID());
}

template<>
int CRankArray<CManorBattleDefUnit, MAX_MANOR_BATTLE_DEFEND_RANK>::CmpFunc(
        CManorBattleDefUnit& stA, CManorBattleDefUnit& stB) const
{
    if (stA.GetScore() > stB.GetScore())
    {
        return 1;
    }
    else if (stA.GetScore() < stB.GetScore())
    {
        return -1;
    }

    return 0;
}

template<>
bool CRankArray<CManorBattleAtkUnit, MAX_MANOR_BATTLE_ATTACK_RANK>::IsSame(
        CManorBattleAtkUnit& stA, CManorBattleAtkUnit& stB) const
{
    return (stA.GetGID() == stB.GetGID());
}

template<>
int CRankArray<CManorBattleAtkUnit, MAX_MANOR_BATTLE_ATTACK_RANK>::CmpFunc(
        CManorBattleAtkUnit& stA, CManorBattleAtkUnit& stB) const
{
    if (stA.GetScore() > stB.GetScore())
    {
        return 1;
    }
    else if (stA.GetScore() < stB.GetScore())
    {
        return -1;
    }

    return 0;
}

template<>
bool CRankArray<CManorBattleClanUnit, MAX_MANOR_BATTLE_ATK_CLAN_RANK>::IsSame(
        CManorBattleClanUnit& stA, CManorBattleClanUnit& stB) const
{
    return (stA.GetGID() == stB.GetGID());
}

template<>
int CRankArray<CManorBattleClanUnit, MAX_MANOR_BATTLE_ATK_CLAN_RANK>::CmpFunc(
        CManorBattleClanUnit& stA, CManorBattleClanUnit& stB) const
{
    if (stA.GetScore() > stB.GetScore())
    {
        return 1;
    }
    else if (stA.GetScore() < stB.GetScore())
    {
        return -1;
    }

    return 0;
}

template<>
bool CRankArray<CManorBattleDefTag, MAX_MANOR_BATTLE_DEFEND_LIST>::IsSame(
        CManorBattleDefTag& stA, CManorBattleDefTag& stB) const
{
    return (stA.GetGID() == stB.GetGID());
}

template<>
int CRankArray<CManorBattleDefTag, MAX_MANOR_BATTLE_DEFEND_LIST>::CmpFunc(
        CManorBattleDefTag& stA, CManorBattleDefTag& stB) const
{
    if (stA.GetScore() > stB.GetScore())
    {
        return 1;
    }
    else if (stA.GetScore() < stB.GetScore())
    {
        return -1;
    }

    return 0;
}

template<>
bool CRankArray<CManorBattleAtkTag, MAX_MANOR_BATTLE_ATTACK_LIST>::IsSame(
        CManorBattleAtkTag& stA, CManorBattleAtkTag& stB) const
{
    return (stA.GetGID() == stB.GetGID());
}

template<>
int CRankArray<CManorBattleAtkTag, MAX_MANOR_BATTLE_ATTACK_LIST>::CmpFunc(
        CManorBattleAtkTag& stA, CManorBattleAtkTag& stB) const
{
    if (stA.GetScore() > stB.GetScore())
    {
        return 1;
    }
    else if (stA.GetScore() < stB.GetScore())
    {
        return -1;
    }

    return 0;
}

